Learn R Programming

Compositional (version 5.5)

Regularised discriminant analysis for Euclidean data: Regularised discriminant analysis for Euclidean data

Description

Regularised discriminant analysis for Euclidean data.

Usage

rda(xnew, x, ina, gam = 1, del = 0)

Arguments

xnew

A matrix with the new data whose group is to be predicted. They have to be continuous.

x

A matrix with the available data. They have to be continuous.

ina

A group indicator variable for the avaiable data.

gam

This is a number between 0 and 1. It is the weight of the pooled covariance and the diagonal matrix.

del

This is a number between 0 and 1. It is the weight of the LDA and QDA.

Value

A list including:

prob

The estimated probabilities of the new data of belonging to each group.

scores

The estimated socres of the new data of each group.

est

The estimated group membership of the new data.

Details

The covariance matrix of each group is calculated and then the pooled covariance matrix. The spherical covariance matrix consists of the average of the pooled variances in its diagonal and zeros in the off-diagonal elements. gam is the weight of the pooled covariance matrix and 1-gam is the weight of the spherical covariance matrix, Sa = gam * Sp + (1-gam) * sp. Then it is a compromise between LDA and QDA. del is the weight of Sa and 1-del the weight of each group covariance group. This function is a wrapper for alfa.rda.

References

Friedman Jerome, Trevor Hastie and Robert Tibshirani (2009). The elements of statistical learning, 2nd edition. Springer, Berlin

Tsagris M., Preston S. and Wood A.T.A. (2016). Improved classification for compositional data using the \(\alpha\)-transformation. Journal of classification, 33(2): 243-261. http://arxiv.org/pdf/1106.1451.pdf

See Also

rda.tune, alfa

Examples

Run this code
# NOT RUN {
x <- as.matrix(iris[, 1:4])
ina <- iris[, 5]
mod <- rda(x, x, ina)
table(ina, mod$est)
# }

Run the code above in your browser using DataLab